package events.containers2;

import java.util.AbstractSet;
import java.util.EventListener;
import java.util.EventObject;
import java.util.Iterator;
import java.util.LinkedList;


import zerdlib.events.DefaultListenable;
import zerdlib.events.GenericListener;
import zerdlib.events.containers.ListenableSet;


public class ListenableSortedSet<E, K extends Comparable<K>> extends AbstractSet<E> implements ListenableSet<E> {
	protected DefaultListenable listenableManager = new DefaultListenable();
	@Override
	public void addListener(GenericListener toAddListener) {
		listenableManager.addListener(toAddListener);
	}

	@Override
	public void removeListener(EventListener toRemoveListener) {
		listenableManager.removeListener(toRemoveListener);
	}

	@Override
	public void suspendEvents() {
		listenableManager.suspendEvents();
	}

	@Override
	public void resumeEvents() {
		listenableManager.resumeEvents();
	}

	@Override
	public void fireEvent(EventObject ev) {
		listenableManager.fireEvent(ev);
	}
	
	
	
	
	
	LinkedList<E> set = new LinkedList<>();
	
	private boolean containsReference(E e) {
		for(E i : set) {
			if(i == e) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public boolean add(E e) {
		// TODO Auto-generated method stub
		return super.add(e);
	}
	
	@Override
	public Iterator<E> iterator() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int size() {
		// TODO Auto-generated method stub
		return 0;
	}

}
